cmake_minimum_required(VERSION 2.8)
project(NCDGUI C)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")

include(TestBigEndian)

find_package(GTK2 2.10 REQUIRED gtk)

add_definitions(-std=gnu99 -Werror=implicit-function-declaration -Wno-unused-value -Wno-parentheses -Wno-switch-enum -Wredundant-decls)

add_definitions(-DBADVPN_LINUX -DBADVPN_USE_SIGNALFD -DBADVPN_USE_EPOLL -DBADVPN_BREACTOR_GLIB)

include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${GTK2_INCLUDE_DIRS}
)

test_big_endian(BIG_ENDIAN)
if (BIG_ENDIAN)
    add_definitions(-DBADVPN_BIG_ENDIAN)
else ()
    add_definitions(-DBADVPN_LITTLE_ENDIAN)
endif ()

set(GLIB2_LIBRARIES ${GTK2_LIBRARIES})

add_subdirectory(base)
add_subdirectory(system)
add_subdirectory(flow)
add_subdirectory(ncd)
add_subdirectory(ncdgui)
